package com.java.jvm.demo.chapter03;

/**
 * @author wangning
 * @create 2021-12-09 16:45
 */
public class StaticMethodTest {
	public static void main(String[] args) {
		Thread t1 = new Thread(new Runnable() {
			@Override
			public void run() {
				test();
			}
		});
		Thread t2 = new Thread(() -> test());
		Thread t3 = new Thread(new Runnable() {
			@Override
			public void run() {
				test();
			}
		});
//		Thread t4 = new Thread();
//		Thread t5 = new Thread();
		t1.start();
		t2.start();
		t3.start();
	}

	public static void test() {
		while (true) {
			try {

				System.out.println("" + Thread.currentThread().getName());
				Thread.sleep(3000);
			} catch (InterruptedException e) {
				e.printStackTrace();
			}
		}
	}
}
